public class Flooring extends Material{

	private static double limit=0.02;
	private double widthOfFlooring;
	
	
	public Flooring(String name, double price, double width){
		super(name, price);
		widthOfFlooring = width;		
	}
	
	public double getWidth(){
		return widthOfFlooring;
	}
	
	public double getMaterialReq(Surface s) {
		double lengthSurface = s.getLength();
		double widthSurface = s.getWidth();
		int noOfWidths = (int) (lengthSurface / widthOfFlooring);
		double remnant = lengthSurface % widthOfFlooring;
		
		if (remnant >= limit) {
		noOfWidths++;
		}
		
	return noOfWidths * widthSurface;
	}
	
}
